<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="bp" value="${pageContext.request.contextPath}"></c:set>
<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>蓝天洗衣店</title>

    <!-- Bootstrap Core CSS -->
    <link href="${bp}/static/admin/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">

    <!-- MetisMenu CSS -->
    <link href="${bp}/static/admin/vendor/metisMenu/metisMenu.min.css" rel="stylesheet">

    <!-- Custom CSS -->
    <link href="${bp}/static/admin/dist/css/sb-admin-2.css" rel="stylesheet">

    <!-- Morris Charts CSS -->
    <link href="${bp}/static/admin/vendor/morrisjs/morris.css" rel="stylesheet">

    <!-- Custom Fonts -->
    <link href="${bp}/static/admin/vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
        <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

</head>

<body>

    <div id="wrapper">

        <!-- Navigation -->
        <!-- Navigation -->
        <nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="index.jsp">蓝天洗衣店</a>
            </div>
            <!-- /.navbar-header -->

            <ul class="nav navbar-top-links navbar-right">
                <!-- /.dropdown -->
                <li class="dropdown">
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                        <i class="fa fa-bell fa-fw"></i> <i class="fa fa-caret-down"></i>
                    </a>
                    <ul class="dropdown-menu dropdown-alerts">

                        <li>
                            <a href="#">
                                <div>
                                    <i class="fa fa-comment fa-fw"></i> 衣服洗好了，正在配送
                                    <span class="pull-right text-muted small">4 小时前</span>
                                </div>
                            </a>
                        </li>

                    </ul>
                    <!-- /.dropdown-alerts -->
                </li>
                <!-- /.dropdown -->
                <!-- 右上角 用户设置入口 -->
                <li class="dropdown">
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                        ${sessionScope.user.name} <i class="fa fa-user fa-fw"></i> <i class="fa fa-caret-down"></i>
                    </a>
                    <ul class="dropdown-menu dropdown-user">
                        <li><a href="${bp}/adminUser/userinfo"><i class="fa fa-user fa-fw"></i> 用户信息</a>
                        </li>
                        <li><a href="${bp}/vip/index"><i class="fa fa-gear fa-fw"></i> 会员管理</a>
                        </li>
                        <li class="divider"></li>
                        <li><a href="${bp}/adminUser/loginOut"><i class="fa fa-sign-out fa-fw"></i> 退出</a>
                        </li>
                    </ul>
                    <!-- /.dropdown-user -->
                </li>
                <!-- /.dropdown -->
            </ul>
            <div class="navbar-default sidebar" role="navigation">
                <div class="sidebar-nav navbar-collapse">
                    <ul class="nav" id="side-menu">
                        <li class="sidebar-search">
                            <div class="input-group custom-search-form">
                                <input type="text" class="form-control" placeholder="Search...">
                                <span class="input-group-btn">
                                <button class="btn btn-default" type="button">
                                    <i class="fa fa-search"></i>
                                </button>
                            </span>
                            </div>
                            <!-- /input-group -->
                        </li>
                        <li>
                            <a href="${bp}/adminUser/adminIndex"><i class="fa fa-dashboard fa-fw"></i> 首页</a>
                        </li>
                        <li>
                            <a href="${bp}/adminOder/index"><i class="fa fa-dashboard fa-fw"></i> 快速订购</a>
                        </li>
                        <li>
                            <a href="${bp}/adminOder/orderRecord"><i class="fa fa-dashboard fa-fw"></i>订购记录</a>
                        </li>
                        <li>
                            <a href="${bp}/vip/index"><i class="fa fa-dashboard fa-fw"></i>会员管理</a>
                        </li>
                    </ul>
                </div>
                <!-- /.sidebar-collapse -->
            </div>
            <!-- /.navbar-static-side -->
        </nav>
        <div id="page-wrapper">
            <div class="row">
                <div class="col-md-12">
                    <h1 class="page-header">用户信息</h1>
                </div>
                <!-- /.col-lg-12 -->
            </div>
            <div class="row">
                <div class="col-md-8">
                    <form id="user">
                        <input type="hidden" value="${user.id}" name="id"/>
                        <!-- 用户姓名 -->
                        <div class="form-group input-group">
                            <span class="input-group-addon">姓名</span>
                            <input type="text" value="${user.name}" name="name" class="form-control" placeholder="姓名"/>
                        </div>
                        <!-- 用户名 -->
                        <div class="form-group input-group">
                            <span class="input-group-addon">用户名</span>
                            <input type="text"  value="${user.username}" name="username" class="form-control" placeholder="用户名"/>
                        </div>
                        <!-- 用户密码 -->
                        <div class="form-group input-group">
                            <span class="input-group-addon">密码</span>
                            <input type="password"  value="${user.password}" name="password" class="form-control" placeholder="用户密码"/>
                        </div>
                        <!-- 用户手机号 -->
                        <div class="form-group input-group">
                            <span class="input-group-addon">手机号</span>
                            <input type="text"  value="${user.phone}" name="phone" class="form-control" placeholder="用户手机号"/>
                        </div>
                        <!-- 用户手机号 -->
                        <div class="form-group input-group">
                            <span class="input-group-addon">地址</span>
                            <input type="text"  value="${user.addr}" name="addr" class="form-control" placeholder="用户手机号"/>
                        </div>
                        <button type="button" onclick="update()"  class="btn btn-default">确认修改</button>
                    </form>
                </div>

            </div>
        </div>
        <!-- /#page-wrapper -->

    </div>
    <!-- /#wrapper -->

    <!-- jQuery -->
    <script src="${bp}/static/admin/vendor/jquery/jquery.min.js"></script>

    <!-- Bootstrap Core JavaScript -->
    <script src="${bp}/static/admin/vendor/bootstrap/js/bootstrap.min.js"></script>

    <!-- Metis Menu Plugin JavaScript -->
    <script src="${bp}/static/admin/vendor/metisMenu/metisMenu.min.js"></script>

    <!-- Morris Charts JavaScript -->
    <script src="${bp}/static/admin/vendor/raphael/raphael.min.js"></script>
    <script src="${bp}/static/admin/vendor/morrisjs/morris.min.js"></script>
    <script src="${bp}/static/admin/data/morris-data.js"></script>

    <!-- Custom Theme JavaScript -->
    <script src="${bp}/static/admin/dist/js/sb-admin-2.js"></script>

</body>
<script type="text/javascript">

    function update() {

        $.ajax({
            type: "POST",
            url: "${bp}/adminUser/userAdminUpdate",
            data: $('#user').serialize(),
            success: function (msg) {
                if (msg == "1") {
                    alert("更新成功");
                    window.location.href="${bp}/adminUser/userinfo"
                } else {
                    alert("更新失败")
                    return false;
                }
            }
        });
    }
</script>
</html>